package gqz.testdemo;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;

import java.math.BigDecimal;
import java.text.DecimalFormat;

/**
 * Created by Administrator on 2018/7/23.
 */

public class TextSpacingActivity extends Activity {

    private String TAG = getClass().getName() + "-->";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_textspacing);

        for (float i = -0.4f; i <= 2f; i += 0.05) {
            BigDecimal big = new BigDecimal(i);
            i = big.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
            DecimalFormat df = new DecimalFormat("0.00");
            Log.d(TAG, "i = " + df.format(i));
        }
    }
}
